#!/usr/bin/python3.8.9
# -*- coding: utf-8 -*-

# @Author  : Tina Yu
# @Time    : 2021-7-21 20:14
"""
异常处理
"""

# ZeroDivisionError
print("请输入两个数字，我们将进行除数计算！输入q退出。")

while True:
    first_num = input("请输入第一个数字：")
    if first_num == 'q':
        break
    second_num = input("请输入第二个数字：")
    if second_num == 'q':
        break
    try:
        result = int(first_num) / int(second_num)
    except ValueError as e:
        # print("输入的非数值！" )
        pass
    except ZeroDivisionError as e:
        # print("0不能做除数！", e)
        pass
    else:
        print(result)
